package com.itheima.branch;

public class IfTest1 {

    public static void main(String[] args) {

        //需求：汽车自动驾驶，根据红绿灯的颜色，判断是否通过
        ifPass();
    }

    public static void ifPass() {
        boolean red = true;
        boolean green = false;
        boolean yellow = false;

        if (red) {
            System.out.println("停止");
        } else if (green) {
            System.out.println("通过");
        } else if (yellow) {
            System.out.println("准备");
        } else {
            System.out.println("未知");
        }
    }

}
